(ns example.core
  (:require
   [redrouter.core :refer [start!]]
   [reagent.core :as reagent :refer [atom]]))

;; define your app data so that it doesn't get over-written on reload

(defonce app-state (atom {:text "Hello world!"}))

(defn hello-world []
  [:div
   [:h1 "zzz"]
   [:h3 "Edit this and watch it change!"]])

(defn text []
  [:h3 "ssss"])

(def routes
  [{:path "/"
    :component hello-world}])

(defn start []
  (start!
   {:routes routes}))

(defn ^:export init []
  ;; init is called ONCE when the page loads
  ;; this is called in the index.html and must be exported
  ;; so it is available even in :advanced release builds
  (start))

(defn stop []
  ;; stop is called before any code is reloaded
  ;; this is controlled by :before-load in the config
  (js/console.log "stop"))
